package Tools.FunctionInterface;

import java.util.function.Predicate;

public class PredicateTest {
    public static void main(String[] args) {
        fun(s -> {
            return s.length() > 3;
        },"ewqe");

        fun1(s -> {
            return s.contains("h");
        },s1 -> {
            return s1.contains("w");
        });


        boolean test = Predicate.isEqual(new Object()).test(new String());
        System.out.println(test);
    }

    private static void fun(Predicate<String> predicate,String str){
        boolean test = predicate.test(str);
        boolean test2 = predicate.test(str);
        System.out.println(test+" "+ test2);
    }

    private static void fun1(Predicate<String> p1,Predicate<String> p2){
        boolean hello = p1.and(p2).test("hello");
        boolean hello1 = p1.or(p2).test("hello");
        boolean hello2 = p1.negate().test("hello");
        System.out.println(hello+" "+ hello1+" "+hello2);

    }
}
